Fixed GtkGrid GtkContainerClass->forall() to not use a for loop.
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Wed, 22 Dec 2010 12:21:44 +0000 (21:21 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Wed, 22 Dec 2010 12:25:53 +0000 (21:25 +0900)
This loop needs to be safe for removing children in a forall loop.

gtk/gtkgrid.c

index 7aaf8ef818924f963fb1ecfc208166e4c1a1a648..3557c16949bd9027a5fcc39fdffadf4a389b1f22 100644 (file)
@@ -439,9 +439,11 @@ gtk_grid_forall (GtkContainer *container,
   GtkGridChild *child;
   GList *list;
 
-  for (list = priv->children; list; list = list->next)
+  list = priv->children;
+  while (list)
     {
       child = list->data;
+      list  = list->next;
 
       (* callback) (child->widget, callback_data);
     }